<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    div {
        width: 200px;
        height: 900px;
        background-color: pink;
    }
</style>

<body>
    <div> </div>
    <script>
        var div = document.querySelector("div")
            // window.onresize = function() {
            //     alert(11)
            // }
        window.addEventListener('resize', function() {
            if (window.innerWidth <= 900) {
                div.style.display = 'none';
                // alert(22)
            } else {
                div.style.display = "block";

            }
        })
    </script>
</body>

</html>